/*
 * @Author: 'zhangkeqq' '2211709169@qq.com'
 * @Date: 2025-07-24 14:29:50
 * @LastEditors: 'zhangkeqq' '2211709169@qq.com'
 * @LastEditTime: 2025-07-24 14:34:23
 * @FilePath: \node-express\limit\login.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const joi = require('joi')

/**
 * string 值只能为字符串
 * alphanum 值只能为a-z A-Z 0-9
 * min 是最小程度  max 是最大长度
 * required 是必填项
 * pattern 是正则
 */
//账号的验证
const account = joi.string().alphanum().min(6).max(12).required()
//密码的验证
const password = joi.string().pattern(/^(?![0-9]+$)[a-z0-9]{1,50}$/).min(6).max(12).required()


exports.login_limit = {
    //表示对req.body里面的数据进行验证
    body:{
        account,
        password
    }
}